home *** CD-ROM | disk | FTP | other *** search
/ Sky at Night 2007 June / SAN CD 6-2007 CD-ROM 25.iso / pc / Software / AstroGrav_Win / Java / jre1.6.0 / lib / rt.jar / javax / swing / JTabbedPane$Page.class (.txt) < prev    next >
Encoding:
Java Class File  |  2006-11-29  |  6.1 KB  |  274 lines

  1. package javax.swing;
  2.  
  3. import java.awt.Color;
  4. import java.awt.Component;
  5. import java.awt.Cursor;
  6. import java.awt.Dimension;
  7. import java.awt.Font;
  8. import java.awt.FontMetrics;
  9. import java.awt.Point;
  10. import java.awt.Rectangle;
  11. import java.awt.event.FocusListener;
  12. import java.io.Serializable;
  13. import java.util.Locale;
  14. import javax.accessibility.Accessible;
  15. import javax.accessibility.AccessibleComponent;
  16. import javax.accessibility.AccessibleContext;
  17. import javax.accessibility.AccessibleIcon;
  18. import javax.accessibility.AccessibleRole;
  19. import javax.accessibility.AccessibleState;
  20. import javax.accessibility.AccessibleStateSet;
  21.  
  22. class JTabbedPane$Page extends AccessibleContext implements Serializable, Accessible, AccessibleComponent {
  23.    String title;
  24.    Color background;
  25.    Color foreground;
  26.    Icon icon;
  27.    Icon disabledIcon;
  28.    JTabbedPane parent;
  29.    Component component;
  30.    String tip;
  31.    boolean enabled;
  32.    boolean needsUIUpdate;
  33.    int mnemonic;
  34.    int mnemonicIndex;
  35.    Component tabComponent;
  36.    // $FF: synthetic field
  37.    final JTabbedPane this$0;
  38.  
  39.    JTabbedPane$Page(JTabbedPane var1, JTabbedPane var2, String var3, Icon var4, Icon var5, Component var6, String var7) {
  40.       this.this$0 = var1;
  41.       this.enabled = true;
  42.       this.mnemonic = -1;
  43.       this.mnemonicIndex = -1;
  44.       this.title = var3;
  45.       this.icon = var4;
  46.       this.disabledIcon = var5;
  47.       this.parent = var2;
  48.       this.setAccessibleParent(var2);
  49.       this.component = var6;
  50.       this.tip = var7;
  51.       this.initAccessibleContext();
  52.    }
  53.  
  54.    void initAccessibleContext() {
  55.       if (this.this$0.accessibleContext != null && this.component instanceof Accessible) {
  56.          AccessibleContext var1 = ((Accessible)this.component).getAccessibleContext();
  57.          if (var1 != null) {
  58.             var1.setAccessibleParent(this);
  59.          }
  60.       }
  61.  
  62.    }
  63.  
  64.    void setMnemonic(int var1) {
  65.       this.mnemonic = var1;
  66.       this.updateDisplayedMnemonicIndex();
  67.    }
  68.  
  69.    int getMnemonic() {
  70.       return this.mnemonic;
  71.    }
  72.  
  73.    void setDisplayedMnemonicIndex(int var1) {
  74.       if (this.mnemonicIndex != var1) {
  75.          if (var1 != -1 && (this.title == null || var1 < 0 || var1 >= this.title.length())) {
  76.             throw new IllegalArgumentException("Invalid mnemonic index: " + var1);
  77.          }
  78.  
  79.          this.mnemonicIndex = var1;
  80.          JTabbedPane.access$000(this.this$0, "displayedMnemonicIndexAt", (Object)null, (Object)null);
  81.       }
  82.  
  83.    }
  84.  
  85.    int getDisplayedMnemonicIndex() {
  86.       return this.mnemonicIndex;
  87.    }
  88.  
  89.    void updateDisplayedMnemonicIndex() {
  90.       this.setDisplayedMnemonicIndex(SwingUtilities.findDisplayedMnemonicIndex(this.title, this.mnemonic));
  91.    }
  92.  
  93.    public AccessibleContext getAccessibleContext() {
  94.       return this;
  95.    }
  96.  
  97.    public String getAccessibleName() {
  98.       if (this.accessibleName != null) {
  99.          return this.accessibleName;
  100.       } else {
  101.          return this.title != null ? this.title : null;
  102.       }
  103.    }
  104.  
  105.    public String getAccessibleDescription() {
  106.       if (this.accessibleDescription != null) {
  107.          return this.accessibleDescription;
  108.       } else {
  109.          return this.tip != null ? this.tip : null;
  110.       }
  111.    }
  112.  
  113.    public AccessibleRole getAccessibleRole() {
  114.       return AccessibleRole.PAGE_TAB;
  115.    }
  116.  
  117.    public AccessibleStateSet getAccessibleStateSet() {
  118.       AccessibleStateSet var1 = this.parent.getAccessibleContext().getAccessibleStateSet();
  119.       var1.add(AccessibleState.SELECTABLE);
  120.       int var2 = this.parent.indexOfTab(this.title);
  121.       if (var2 == this.parent.getSelectedIndex()) {
  122.          var1.add(AccessibleState.SELECTED);
  123.       }
  124.  
  125.       return var1;
  126.    }
  127.  
  128.    public int getAccessibleIndexInParent() {
  129.       return this.parent.indexOfTab(this.title);
  130.    }
  131.  
  132.    public int getAccessibleChildrenCount() {
  133.       return this.component instanceof Accessible ? 1 : 0;
  134.    }
  135.  
  136.    public Accessible getAccessibleChild(int var1) {
  137.       return this.component instanceof Accessible ? (Accessible)this.component : null;
  138.    }
  139.  
  140.    public Locale getLocale() {
  141.       return this.parent.getLocale();
  142.    }
  143.  
  144.    public AccessibleComponent getAccessibleComponent() {
  145.       return this;
  146.    }
  147.  
  148.    public Color getBackground() {
  149.       return this.background != null ? this.background : this.parent.getBackground();
  150.    }
  151.  
  152.    public void setBackground(Color var1) {
  153.       this.background = var1;
  154.    }
  155.  
  156.    public Color getForeground() {
  157.       return this.foreground != null ? this.foreground : this.parent.getForeground();
  158.    }
  159.  
  160.    public void setForeground(Color var1) {
  161.       this.foreground = var1;
  162.    }
  163.  
  164.    public Cursor getCursor() {
  165.       return this.parent.getCursor();
  166.    }
  167.  
  168.    public void setCursor(Cursor var1) {
  169.       this.parent.setCursor(var1);
  170.    }
  171.  
  172.    public Font getFont() {
  173.       return this.parent.getFont();
  174.    }
  175.  
  176.    public void setFont(Font var1) {
  177.       this.parent.setFont(var1);
  178.    }
  179.  
  180.    public FontMetrics getFontMetrics(Font var1) {
  181.       return this.parent.getFontMetrics(var1);
  182.    }
  183.  
  184.    public boolean isEnabled() {
  185.       return this.enabled;
  186.    }
  187.  
  188.    public void setEnabled(boolean var1) {
  189.       this.enabled = var1;
  190.    }
  191.  
  192.    public boolean isVisible() {
  193.       return this.parent.isVisible();
  194.    }
  195.  
  196.    public void setVisible(boolean var1) {
  197.       this.parent.setVisible(var1);
  198.    }
  199.  
  200.    public boolean isShowing() {
  201.       return this.parent.isShowing();
  202.    }
  203.  
  204.    public boolean contains(Point var1) {
  205.       Rectangle var2 = this.getBounds();
  206.       return var2.contains(var1);
  207.    }
  208.  
  209.    public Point getLocationOnScreen() {
  210.       Point var1 = this.parent.getLocationOnScreen();
  211.       Point var2 = this.getLocation();
  212.       var2.translate(var1.x, var1.y);
  213.       return var2;
  214.    }
  215.  
  216.    public Point getLocation() {
  217.       Rectangle var1 = this.getBounds();
  218.       return new Point(var1.x, var1.y);
  219.    }
  220.  
  221.    public void setLocation(Point var1) {
  222.    }
  223.  
  224.    public Rectangle getBounds() {
  225.       return this.parent.getUI().getTabBounds(this.parent, this.parent.indexOfTab(this.title));
  226.    }
  227.  
  228.    public void setBounds(Rectangle var1) {
  229.    }
  230.  
  231.    public Dimension getSize() {
  232.       Rectangle var1 = this.getBounds();
  233.       return new Dimension(var1.width, var1.height);
  234.    }
  235.  
  236.    public void setSize(Dimension var1) {
  237.    }
  238.  
  239.    public Accessible getAccessibleAt(Point var1) {
  240.       return this.component instanceof Accessible ? (Accessible)this.component : null;
  241.    }
  242.  
  243.    public boolean isFocusTraversable() {
  244.       return false;
  245.    }
  246.  
  247.    public void requestFocus() {
  248.    }
  249.  
  250.    public void addFocusListener(FocusListener var1) {
  251.    }
  252.  
  253.    public void removeFocusListener(FocusListener var1) {
  254.    }
  255.  
  256.    public AccessibleIcon[] getAccessibleIcon() {
  257.       AccessibleIcon var1 = null;
  258.       if (this.enabled && this.icon instanceof ImageIcon) {
  259.          AccessibleContext var3 = ((ImageIcon)this.icon).getAccessibleContext();
  260.          var1 = (AccessibleIcon)var3;
  261.       } else if (!this.enabled && this.disabledIcon instanceof ImageIcon) {
  262.          AccessibleContext var2 = ((ImageIcon)this.disabledIcon).getAccessibleContext();
  263.          var1 = (AccessibleIcon)var2;
  264.       }
  265.  
  266.       if (var1 != null) {
  267.          AccessibleIcon[] var4 = new AccessibleIcon[]{var1};
  268.          return var4;
  269.       } else {
  270.          return null;
  271.       }
  272.    }
  273. }
  274.